import turtle
import time

# 设置画布和初始参数
screen = turtle.Screen()
screen.title("奶龙")
screen.bgcolor("#f0f0f0")
screen.setup(width=800, height=600)

# 创建画笔
pen = turtle.Turtle()
pen.speed(3)  # 绘制速度，1-10，0为最快
pen.pensize(3)
pen.hideturtle()

def draw_circle(radius, color, x=0, y=0):
    """绘制一个圆形"""
    pen.penup()
    pen.goto(x, y - radius)  # 移动到圆形底部
    pen.pendown()
    pen.fillcolor(color)
    pen.begin_fill()
    pen.circle(radius)
    pen.end_fill()

def draw_ellipse(radius, color, angle=0, x=0, y=0):
    """绘制一个椭圆形"""
    pen.penup()
    pen.goto(x, y)
    pen.pendown()
    pen.fillcolor(color)
    pen.begin_fill()
    pen.setheading(angle)
    for _ in range(2):
        pen.circle(radius, 90)
        pen.circle(radius//2, 90)
    pen.end_fill()

def draw_nailong():
    """绘制奶龙"""
    # 绘制身体（黄色）
    draw_circle(100, "#FFD700", 0, -50)
    
    # 绘制肚子（浅黄色）
    draw_circle(70, "#FFFFE0", 0, 20)
    
    # 绘制头部（黄色）
    draw_circle(70, "#FFD700", 0, 120)
    
    # 绘制眼睛（白色）
    draw_circle(15, "white", -30, 160)
    draw_circle(15, "white", 30, 160)
    
    # 绘制眼珠（黑色）
    draw_circle(7, "black", -35, 165)
    draw_circle(7, "black", 25, 165)
    
    # 绘制高光（白色小点）
    draw_circle(3, "white", -40, 170)
    draw_circle(3, "white", 20, 170)
    
    # 绘制嘴巴（红色椭圆）
    pen.penup()
    pen.goto(-15, 130)
    pen.pendown()
    pen.fillcolor("#FF6347")
    pen.begin_fill()
    pen.setheading(270)
    pen.circle(15, 180)
    pen.end_fill()
    
    # 绘制腮红（粉色圆形）
    draw_circle(10, "#FFB6C1", -60, 140)
    draw_circle(10, "#FFB6C1", 60, 140)
    
    # 绘制手臂（黄色）
    pen.penup()
    pen.goto(-100, 50)
    pen.pendown()
    pen.fillcolor("#FFD700")
    pen.begin_fill()
    pen.setheading(180)
    pen.forward(60)
    pen.setheading(270)
    pen.forward(20)
    pen.setheading(0)
    pen.forward(60)
    pen.setheading(90)
    pen.forward(20)
    pen.end_fill()
    
    pen.penup()
    pen.goto(100, 50)
    pen.pendown()
    pen.fillcolor("#FFD700")
    pen.begin_fill()
    pen.setheading(0)
    pen.forward(60)
    pen.setheading(270)
    pen.forward(20)
    pen.setheading(180)
    pen.forward(60)
    pen.setheading(90)
    pen.forward(20)
    pen.end_fill()
    
    # 绘制腿（黄色）
    draw_ellipse(30, "#FFD700", 0, -50, -120)
    draw_ellipse(30, "#FFD700", 0, 50, -120)
    
    # 绘制尾巴（黄色）
    pen.penup()
    pen.goto(-120, -30)
    pen.pendown()
    pen.fillcolor("#FFD700")
    pen.begin_fill()
    pen.setheading(180)
    pen.forward(70)
    pen.setheading(135)
    pen.forward(40)
    pen.setheading(45)
    pen.forward(40)
    pen.end_fill()
    
    # 绘制头顶小突起（黄色）
    pen.penup()
    pen.goto(-15, 190)
    pen.pendown()
    pen.fillcolor("#FFD700")
    pen.begin_fill()
    pen.setheading(90)
    pen.forward(30)
    pen.setheading(0)
    pen.forward(10)
    pen.setheading(270)
    pen.forward(30)
    pen.setheading(180)
    pen.forward(10)
    pen.end_fill()
    
    pen.penup()
    pen.goto(15, 190)
    pen.pendown()
    pen.fillcolor("#FFD700")
    pen.begin_fill()
    pen.setheading(90)
    pen.forward(25)
    pen.setheading(0)
    pen.forward(10)
    pen.setheading(270)
    pen.forward(25)
    pen.setheading(180)
    pen.forward(10)
    pen.end_fill()

# 绘制奶龙
draw_nailong()

# 添加文字
pen.penup()
pen.goto(0, -250)
pen.pendown()
pen.color("#FF6347")
pen.write("可爱的奶龙", align="center", font=("SimHei", 24, "bold"))

# 保持窗口打开
turtle.done()
    